package com.weijianhuawen.wjblog.admin.convert;

import com.weijianhuawen.wjblog.admin.mode.vo.setting.FindBlogSettingsRspVo;
import com.weijianhuawen.wjblog.admin.mode.vo.setting.UpdateBlogSettingsReqVo;
import com.weijianhuawen.wjblog.common.domain.dos.BlogSettingsDo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @version: java version 8
 * @Author: weijianhuawen
 * @description:
 * @date: 2024-10-23 22:39
 */

@Mapper
public interface BlogSettingsConvert {

    //初始化 convert 实例
    BlogSettingsConvert INSTANCE = Mappers.getMapper(BlogSettingsConvert.class);

    /**
     * 将 VO 转化为 DO
     * @param bean
     * @return
     */
    @Mappings({
            @Mapping(source = "name", target = "blogName")
    })
    BlogSettingsDo convertVoToDo(UpdateBlogSettingsReqVo bean);

    /**
     * 将DO 转换为 VO
     * @param bean
     * @return
     */
    FindBlogSettingsRspVo convertDoToVo(BlogSettingsDo bean);
}
